package com.thrd.taiexhibition.presener;

import com.thrd.taiexhibition.bean.BeanResearch;
import com.thrd.taiexhibition.callback.MvpCallback;
import com.thrd.taiexhibition.model.ResearchModel;
import com.thrd.taiexhibition.view.ResearchView;

import java.util.List;

/**
 * @author: ${唐杰}
 * @date: 2021/3/30
 */
public class ResearchPresener {
    private ResearchView mResearchView;
    private ResearchModel mResearchModel;

    public ResearchPresener(ResearchView mResearchView){
        this.mResearchView=mResearchView;
        mResearchModel=new ResearchModel();

    }


    public void getResearchData(){
        mResearchModel.getResearchData(new MvpCallback<List<BeanResearch>>() {
            @Override
            public void onSuccess(List<BeanResearch> beanResearches) {
                mResearchView.onSuccess(beanResearches);
            }

            @Override
            public void onFailed(String e, int code) {
                mResearchView.onError(e,code);
            }
        });
    }
}
